<html>
<head>
<meta charset="UTF-8">
<title>批次信息配置新增</title>
<link id="easyuiTheme" id="easyuiTheme" href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
<link href="../../static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
<script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
<script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../static/easyui/jquery.cookie.js" type="text/javascript"></script>
<script src="../../static/easyui/ui-theme.js" type="text/javascript"></script>
<script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
<script src="../../ffres/dict/all.js" type="text/javascript"></script>
<link href="../../static/easyui/themes/frameless.css" rel="stylesheet" type="text/css"/>
<a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<body class="easyui-layout">
	<form id="ff" method="post">
		<div class="esaas-info-title">批次信息配置信息</div>
		<table class="esaas-info-add-table">
			<tr>
				<td width="15%" align="right">批次标识：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="batchId" data-options="required:true"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">批次名称：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="batchName" data-options="required:true"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right">系统代码：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="subsCode" data-options="required:true"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">发起方式：</td>
				<td width="35%"><select class="easyui-combobox"
					id="launchType" name="launchType"
					style="width: 100%; height: 25px;"
					data-options="required:false,editable:false,valueField:'enname',textField:'cnname',data:BAT_LAUNCH_TYPE,onSelect:onLaunchTypeSelect">
				</select></td>
			</tr>
			<tr>
				<td width="15%" align="right">定时周期：</td>
				<td width="35%"><input class="easyui-textbox" type="text" id="batchCronValue"
					name="batchCronValue" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">执行节点标识：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="agentId" data-options="required:true"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right">生效日期：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="validDate" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">任务并发数：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="equallyTaskAmount" data-options="required:true"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right">是否允许重跑：</td>
				<td width="35%"><select class="easyui-combobox"
					id="isRunAgain" name="isRunAgain"
					style="width: 100%; height: 25px;"
					data-options="required:false,editable:false,valueField:'enname',textField:'cnname',data:STD_PUB_YN">
				</select></td>
			</tr>
			<tr>
				<td width="15%" align="right">备注：</td>
				<td width="85%" colspan="3"><input class="easyui-textbox" type="text"
					name="remark" data-options="required:false, multiline: true"
					style="width: 100%; height: 50px;"></input></td>
			</tr>
		</table>
	</form>
	<div class="esaas-info-buttons">
		<a href="javascript:void(0)" class="easyui-linkbutton " iconCls="icon-ok" onclick="submitForm()" style="width:90px">&nbsp;保&nbsp;存&nbsp;</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="closeForm()" style="width:90px">&nbsp;关&nbsp;闭&nbsp;</a>
	</div>
	<script>
		$(function() {
		    addTitle("新增");
		});

		function submitForm() {
			if (!$('#ff').form('validate'))
				return;
			var jsonData = $("#ff").serializeJson();
			$.restfulPostJson('../../api/bat/batch/info/config', jsonData, function(data) {
				window.parent.reloadList();
			});
		};
		
		function onLaunchTypeSelect(data) {
			if(data.enname == '1') {
				$('#batchCronValue').textbox('textbox').validatebox({required: true});
			} else {
				$('#batchCronValue').textbox('textbox').validatebox({required: false});
			}
		}
		
		function closeForm() {
			window.parent.JLEUtil.closewin();
		}
	</script>
</body>
</html>